package com.yztstudy.Service.Impl;

import com.yztstudy.Entity.Desk;
import com.yztstudy.Mapper.DeskMapper;
import com.yztstudy.Service.DeskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class DeskServiceImpl implements DeskService {

    @Autowired
    private DeskMapper deskMapper;

    @Override
    public List<Desk> getDesks(String name) {
        return deskMapper.getDesks(name);
    }

    @Override
    public Integer addDesk(Desk desk) {
        return deskMapper.addDesk(desk);
    }

    @Override
    public Integer deleteDesk(Integer id) {
        return deskMapper.deleteDesk(id);
    }

    @Override
    public Integer activeDesk(Integer id) {return deskMapper.activeDesk(id);}

    @Override
    public Integer orderState(Desk desk) {
        return deskMapper.orderState(desk);
    }

    @Override
    public Integer cancelState(Desk desk) {
        return deskMapper.cancelState(desk);
    }

    @Override
    public List<Desk> getFreeDesks() {
        return deskMapper.getFreeDesks();
    }

    @Override
    public Desk getDeskByID(Integer id) {
        return deskMapper.getDeskByID(id);
    }

}
